from django.conf.urls.defaults import patterns, include, url


from storehouse.views import *
from storehouse.views import view_order,inventory_applied,liquidation_view,document_view,error_view,address_view
import settings
from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    url(r'^$','django.contrib.auth.views.login',{'template_name':'logowanie.html'}),
    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    # (r'^main', main_page),
    # (r'^test/', test_page),
    (r'^login/$','django.contrib.auth.views.login',{'template_name':'logowanie.html'}),
    (r'^logout/$','django.contrib.auth.views.logout'),
    (r'^order_view/$',view_order),
    (r'^inventory/$',inventory_applied),
    (r'^document_view/$',document_view),
    (r'^admin/storehouse/print_document/(?P<document_id>\d+)/$', print_document),
    (r'^admin/storehouse/address_view/(?P<address_id>\d+)/$', address_view),
    (r'^liquidation_view/$',liquidation_view),
    (r'^error_view/$',error_view),
    # Uncomment the next line to enable the admin:
     url(r'^admin/', include(admin.site.urls)),
)

urlpatterns += patterns('',
   
    (r'^s_media/(?P<path>.*)$', 'django.views.static.serve',  {'document_root': settings.MEDIA_ROOT}),
    (r'^js/(?P<path>.*)$', 'django.views.static.serve',  {'document_root': settings.JS_DIR}),
    (r'^images/(?P<path>.*)$', 'django.views.static.serve',  {'document_root': settings.IMAGES_DIR}),
    (r'^fancybox/(?P<path>.*)$', 'django.views.static.serve',  {'document_root': settings.FANCYBOX_DIR}),
    (r'^styles/(?P<path>.*)$', 'django.views.static.serve',  {'document_root': settings.STYLES_DIR}),
)
